package com.heima.fangfa;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class Method03 {
    public static void main(String[] args) throws IOException, ClassNotFoundException, InvocationTargetException, IllegalAccessException, NoSuchMethodException, InstantiationException {
        Properties properties = new Properties();
        ClassLoader classLoader = Method03.class.getClassLoader();
        InputStream resource = classLoader.getResourceAsStream("prop.properties");
        properties.load(resource);
        String className = properties.getProperty("className");
        String methodName = properties.getProperty("methodName");
        Class<?> aClass = Class.forName(className);
        Method method = aClass.getMethod(methodName);
        Object o = aClass.getConstructor().newInstance();
        method.invoke(o);


    }
}